﻿using System.Web.Mvc;

namespace Framework.Mvc.Util
{
    /// <summary>
    /// EasyUIGridJson
    /// </summary>
    public class EasyUIGridJsonResult : JsonpResult
    {
        /// <summary>
        /// EasyUIGridJson
        /// </summary>
        /// <param name="total"></param>
        /// <param name="rows"></param>
        /// <param name="behavior"></param>
        public EasyUIGridJsonResult(int total, object rows, JsonRequestBehavior behavior = System.Web.Mvc.JsonRequestBehavior.AllowGet)
        {
            this.Data = new EasyUIGridJsonObject { total = total, rows = rows };
            this.JsonRequestBehavior = behavior;
        }


        /// <summary>
        /// EasyUIGridJsonObject
        /// </summary>
        class EasyUIGridJsonObject
        {
            public int total { get; set; }
            public object rows { get; set; }
        }
    }
}
